let form = layui.form
//获取用户信息
function huitian() {
    $.ajax({
        url: '/my/user/userinfo',
        success: function (res) {
            //数据回填
            form.val('user',res.data)
        }
    })
}
huitian()
$('form').on('submit', function (e) {
    e.preventDefault()
    let data = $(this).serialize()
    $.ajax({
        type:'POST',
        url: '/my/user/userinfo',
        data : data,
        success : function (res) {
            console.log(res);
            if (res.status == 0) {
                layer.msg(res.message)
                window.parent.getUserInfo()
            }
        }
    })
})
$('.reset').on('click', function () {
    huitian()
})